<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .b{
            width: 800px;
            height: 800px;
            background-color: black;
            opacity: 0.35;
        }
        .a{
            width: 400px;
            height: 400px;
            background-color: aqua;
        }
        .as{
            width: 200px;
            height: 200px;
            background-color: yellow;
        }
    </style>
</head>
<body>
    <div class="b">
        <div class="a">
            123456
        </div>
    </div>
</body>
</html>
<script>
    var a=document.querySelector("div")
    a.onclick=function(){
        a.className="as"
    }
</script>